﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AddressView.ascx.cs"
    Inherits="NetDon.OA.Portal.Controls.AddressView" %>
<%@ Register TagPrefix="NetDon" Namespace="NetDon.WebControls" %>

<NetDon:FormPanel runat="server" ID="fpAddress" RepeatColumns="2">
    <Items>
        <NetDon:FormItem HeaderText="Line 1" FullRow="true">
            <ContentTemplate>
                <div>
                    <%# Container.DataItem == null || String.IsNullOrEmpty(Convert.ToString(Eval("AddressLine1"))) ? "&nbsp;" : Server.HtmlEncode(Convert.ToString(Eval("AddressLine1")))%>
                </div>
            </ContentTemplate>
        </NetDon:FormItem>
        <NetDon:FormItem HeaderText="Line 2" FullRow="true">
            <ContentTemplate>
                <div>
                    <%# Container.DataItem == null || String.IsNullOrEmpty(Convert.ToString(Eval("AddressLine2"))) ? "&nbsp;" : Server.HtmlEncode(Convert.ToString(Eval("AddressLine2")))%>
                </div>
            </ContentTemplate>
        </NetDon:FormItem>
        <NetDon:FormItem HeaderText="City">
            <ContentTemplate>
                <div>
                    <%#  Container.DataItem == null || String.IsNullOrEmpty(Convert.ToString(Eval("City"))) ? "&nbsp;" : Server.HtmlEncode(Convert.ToString(Eval("City")))%>
                </div>
            </ContentTemplate>
        </NetDon:FormItem>
        <NetDon:FormItem HeaderText="Zip Code">
            <ContentTemplate>
                <div>
                    <%# Container.DataItem == null || String.IsNullOrEmpty(Convert.ToString(Eval("ZipCode"))) ? "&nbsp;" : Server.HtmlEncode(Convert.ToString(Eval("ZipCode")))%>
                </div>
            </ContentTemplate>
        </NetDon:FormItem>
        <NetDon:FormItem HeaderText="Country">
            <ContentTemplate>
                <div>
                    <%# Container.DataItem == null ? "&nbsp;" : Server.HtmlEncode(GetCountryName((Guid)(Eval("CountryId") ?? Guid.Empty)))%>
                </div>
            </ContentTemplate>
        </NetDon:FormItem>
        <NetDon:FormItem HeaderText="State" Key="State">
            <ContentTemplate>
                <div>
                    <%# Container.DataItem == null || !((Guid?)Eval("StateId")).HasValue ? "&nbsp;" : Server.HtmlEncode(GetStateName((Guid?)Eval("StateId")))%>
                </div>
            </ContentTemplate>
        </NetDon:FormItem>
    </Items>
</NetDon:FormPanel>
